﻿using SmartSapce.ServiceLocation;
using SmartSpace.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SmartSpace.WebApp._console.core
{
    public partial class usergroup_user_list : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid groupId = new Guid(Request.QueryString["id"]);

            ICoreService service = ServiceLocator.Get<ICoreService>();

            //UserGroup group = service.GetUserGroup(groupId);
            PagedList<User> userList = service.GetUserGroupContainUsers(groupId, 0, 999);

            _ctlListUser.DataSource = userList;
            _ctlListUser.DataBind();

            _ctlLinkAssgin.NavigateUrl = string.Format("./usergroup-user-assign.aspx?id={0}", groupId);
            _ctlLinkBack.NavigateUrl = string.Format("./usergroup-list.aspx?id={0}", groupId);
        }
    }
}